{% extends "view.html" %}

{% set column = context[scaffolding.singular] %}

{% block view_header %}
    <a href="{{uri('magazines:view', key=column.publication.urlsafe())}}">{{s.print_value(column.publication)}}</a> - {{ s.print_value(column) }}
{% endblock %}

{% block table_head %}
    <th>issue</th>
    <th>feature title</th>
    <th>artist</th>
    <th></th>
{% endblock %}

{% block table_body %}

    {% for item in context['related'] %}
        {% set issue = item['issue'].get() %}
        <tr>
            <td><a href="{{ uri('issues:view', key=item['issue'].urlsafe()) }}">{{ issue.number_period_year() }}</a></td>
            <td>{{ item['description'] if item['description'] }}</td>
            <td>{% if item['artist'] %}<a href="{{ uri('artists:view', key=item['artist'].urlsafe()) }}">{{ s.print_value(item['artist']) }}</a>{% endif %}</td>
            <td class="text-right">
                {{ buttons.view_edit_delete_buttons(item, controller='features', target='feature') }}
            </td>
        </tr>
    {% endfor %}

{% endblock %}